#!/bin/sh
#
#  This shell script converts the BSD dependent parts of the main shell
#  scripts into something suitable for SystemV.
#
#  This must be run in the top level directory of the sendmail package.
#

for i in Config Dombuild Chnbuild
do
	if [ ! -f $i ]
	then
		echo $i non-existent
		exit 1
	fi

	if [ ! -f $i.bsd ]
	then
		mv $i $i.bsd
	fi
done


#  The top level make file

sed	-e 's/echo -n/echo/' -e 's/\.\.\."/...\\c"/'	Config.bsd > Config

#  The channel make file

sed	-e "s;fmt | sed;nroff | sed -e '/^$/d' -e;"	Chnbuild.bsd > Chnbuild

#  The domain make file

sed	-e "s;tail -r \(...S12\);pr -t -n \1 | sort -r | sed 's/^......//';" \
	-e "s;fmt | sed;nroff | sed -e '/^$/d' -e;"	Dombuild.bsd > Dombuild
